<template>
  <div class="login-container">
  
  </div>
</template>

<script>

export default {
  name: 'LoginSB',
  data() {
    return {
	  loading:true,
	  query:'',
    }
  },
  created() {
	 this.query = this.$route.query
	 if(this.query._api_timestamp) {
		 this.handleLogin(this.query)
	 }else{
		 this.loading = false
		  this.$router.push({ path:'login'})
	 }
  },
  methods: {
    handleLogin(data) {
      this.$store.dispatch('user/loginSuccess',data ).then(res => {
          if (res.state) {
            this.$router.push({ path: this.redirect || '/', query: this.otherQuery })
          } else {
            this.$message.error(res.msg)
			this.$router.push({ path:'login'})
          }
          this.loading = false
        }).catch(() => {
          this.loading = false
		  this.$router.push({ path:'login'})
        })
    },
    
  }
}
</script>

<style lang="scss">
/* 修复input 背景不协调 和光标变色 */
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */

$bg: #F3F3F7;
$light_gray: #000000;
$cursor: #000000;

@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
	.login-container .el-input input {
		color: $cursor;
	}
}

/* reset element-ui css */
.login-container {
	display: flex;
	.el-form-item--medium .el-form-item__content {
		background: #ffffff;
	}
	.el-input {
		display: inline-block;
		height: 47px;
		width: 85%;

		input {
			background: transparent;
			border: 0px;
			-webkit-appearance: none;
			border-radius: 0px;
			padding: 12px 5px 12px 15px;
			color: $light_gray;
			height: 47px;
			caret-color: $cursor;

			&:-webkit-autofill {
				box-shadow: 0 0 0px 1000px #FFFFFF inset !important;
				-webkit-text-fill-color: $cursor !important;
			}
		}
	}

	.el-form-item {
		border: 1px solid rgba(255, 255, 255, 0.1);
		background: rgba(0, 0, 0, 0.1);
		border-radius: 5px;
		color: #454545;
	}
}
</style>

<style lang="scss" scoped>
$bg: #F3F3F7;
$dark_gray:#999999;
$light_gray: #000;

.login-container {

	min-height: 100%;
	width: 100%;
	background-color: $bg;
	overflow: hidden;
	.login-ewm-div{
		margin: 0 auto;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 284px;
		height: 284px;
		background: #FFFFFF;
		margin-bottom: 64px;
		img{
			width: 250px;
			height: 250px;
		}
	}
	.login-nav{
		display: flex;
		align-items: center;
		justify-content: center;
		margin-bottom: 24px;
		.login-nav-col{
			cursor: pointer;
			margin: 0 20px;
			padding-bottom: 30px ;
			height: 24px;
			font-size: 16px;
			font-weight: 400;
			color: #666666;
			line-height: 24px;
			border-bottom: 2px solid #f3f3f7;
		}
		.active {
			color: #C7333A;
			border-bottom: 2px solid #C7333A;
		}
	}
	.login-left{
		width: 50%;
		background: url('../../assets/image/login-bg.png')  no-repeat center center;
		background-size:cover;
		display: flex;
		align-items: center;
		justify-content: center;
		img{
			width: 65%;
		}
	}
	.login-r{
		flex: 1;
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		.technical-support {
			font-size: 14px;
			font-weight: 400;
			color: rgba(0, 0, 0, 0.45);
			line-height: 20px;
			display: flex;
			justify-content: center;
			position: absolute;
			bottom: 50px;
		}

	}
	.login-form {
		position: relative;
		width: 420px;
		max-width: 100%;
		margin: 0 auto;
		overflow: hidden;
		.el-button--primary{
			background-color:#C7333A;
			border-color: #C7333A;
		}

	}

	.tips {
		font-size: 14px;
		color: #fff;
		margin-bottom: 10px;

		span {
			&:first-of-type {
				margin-right: 16px;
			}
		}
	}

	.svg-container {
		padding: 6px 5px 6px 15px;
		color: #C7333A;
		vertical-align: middle;
		width: 30px;
		display: inline-block;
	}

	.title-container {
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-bottom: 54px;
		.title {
			font-size: 33px;
			font-weight: 500;
			color: rgba(0, 0, 0, 0.85);
			line-height: 33px;
		}
		.msg{
			margin-top: 16px;
			font-size: 22px;
			font-weight: 400;
			color: rgba(0, 0, 0, 0.45);
			line-height: 22px
		}

		.set-language {
			color: #fff;
			position: absolute;
			top: 3px;
			font-size: 18px;
			right: 0px;
			cursor: pointer;
		}
	}

	.show-pwd {
		position: absolute;
		right: 10px;
		top: 7px;
		font-size: 16px;
		color: $dark_gray;
		cursor: pointer;
		user-select: none;
	}

	.thirdparty-button {
		position: absolute;
		right: 0;
		bottom: 6px;
	}

	.code-box {
		display: flex;
		align-items: center;
		.imgCode {
			display: flex;
			align-items: center;
			justify-content: flex-end;
		}
		img {
			height: 48px;
			width: 150px;
		}
	}

	@media only screen and (max-width: 470px) {
		.thirdparty-button {
			display: none;
		}
	}
}
</style>
